package com.dhcc.bpm.business.papc.service;

import com.dhcc.bpm.business.papc.entity.JobInfo;
import com.dhcc.bpm.business.papc.vo.JobInfoVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.common.vo.SelectsVo;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.Trigger;
import java.util.List;

/**
 *  服务类
 *
 * @author sjm
 * @since 2020-12-11
 */
public interface IJobInfoService extends IService<JobInfo> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param jobInfo
	 * @return
	 */
	IPage<JobInfoVO> selectJobInfoPage(IPage<JobInfoVO> page, JobInfoVO jobInfo);

	List<SelectsVo> selectJobinfoName();

	//通过Id获取Job
	JobInfo getJobEntityById(Integer id);

	//获取JobKey,包含Name和Group
	JobKey getJobKey(JobInfo job);
	
	//从数据库中加载获取到所有Job
	List<JobInfo> loadJobs();

	//获取JobDataMap.(Job参数对象)
	JobDataMap getJobDataMap(JobInfo job);

	//获取JobDetail,JobDetail是任务的定义,而Job是任务的执行逻辑,JobDetail里会引用一个Job Class来定义
	JobDetail geJobDetail(JobKey jobKey, String description, JobDataMap map, String className);

	//获取Trigger (Job的触发器,执行规则)
	Trigger getTrigger(JobInfo job);
	List<Integer> getGroupNameNum();
}
